package com.blog.controller.active;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.blog.common.base.BaseController;
import com.blog.common.base.ResponseReslut;
import com.blog.entity.active.ActiveType;
import com.blog.service.active.ActiveTypeService;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Controller
@RequestMapping("/activeType")
public class ActiveTypeController extends BaseController {
		
	@Autowired
	private ActiveTypeService activeTypeService;
	
	
	@ResponseBody
	@RequestMapping("/save")
	public ResponseReslut save(ActiveType at)
	{
	    if(activeTypeService.saveActiveType(at)>0)
	    {
	    	return setResultSuccess("添加成功！");
	    }
	    return resultError("添加失败！");
	}
	
	@ResponseBody
	@RequestMapping("/selectAll")
	public ResponseReslut selectAll(Map<String,Object> map)
	{
			List<ActiveType>  listTag=activeTypeService.listAllActiveType(map);
	    	return setResultSuccess("查询成功！",listTag);
 
	}	
}
